{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "#programming_fever\n",
    "#non-photorealistic rendering\n",
    "#using cv2.edgePreservingFilter()\n",
    "import cv2\n",
    "img = cv2.imread(\"E://OpenCV//labrador.jpg\")\n",
    "img=cv2.resize(img,(450,500))\n",
    "img1 = cv2.edgePreservingFilter(img,\n",
    "                    flags=cv2.RECURS_FILTER, sigma_s=60, sigma_r=0.5)\n",
    "img2 = cv2.edgePreservingFilter(img,\n",
    "                    flags=cv2.NORMCONV_FILTER, sigma_s=100, sigma_r=0.4)\n",
    "cv2.imshow('sourceimg', img)\n",
    "cv2.imshow('edgepreserving1', img1)\n",
    "cv2.imshow('edgepreserving2', img2)\n",
    "cv2.waitKey()    \n",
    "cv2.destroyAllWindows() "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "#programming_fever\n",
    "#non-photorealistic rendering\n",
    "#using cv2.DetailEnhance()\n",
    "import cv2\n",
    "img = cv2.imread(\"E://OpenCV//cow.jpg\")\n",
    "img=cv2.resize(img,(500,500))\n",
    "dst = cv2.detailEnhance(img, sigma_s=200, sigma_r=0.1)\n",
    "cv2.imshow('sourceimg', img)\n",
    "cv2.imshow('detail enhanaced',dst)\n",
    "cv2.waitKey()    \n",
    "cv2.destroyAllWindows() "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "#programming_fever\n",
    "#non-photorealistic rendering\n",
    "#using cv2.pencilSketch()\n",
    "import cv2\n",
    "img = cv2.imread(\"E://OpenCV//gold.jpg\")\n",
    "img=cv2.resize(img,(450,500))\n",
    "img1, img2 = cv2.pencilSketch(img, \n",
    "                sigma_s=200, sigma_r=0.1, shade_factor=0.3)\n",
    "cv2.imshow('sourceimg', img)\n",
    "cv2.imshow('graysketch', img1)\n",
    "cv2.imshow('colorsketch', img2)\n",
    "cv2.waitKey()    \n",
    "cv2.destroyAllWindows() "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "#programming_fever\n",
    "#non-photorealistic rendering\n",
    "#using cv2.stylization()\n",
    "import cv2\n",
    "img = cv2.imread(\"E://OpenCV//gold.jpg\")\n",
    "img=cv2.resize(img,(600,600))\n",
    "dst = cv2.stylization(img, sigma_s=200,sigma_r=0.45)\n",
    "gst=cv2.resize(img,(600,600))\n",
    "cv2.imshow('sourceimg', img)\n",
    "cv2.imshow('stylization', dst)\n",
    "cv2.waitKey()    \n",
    "cv2.destroyAllWindows() "
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
